#include "thread.h"
#include <stdio.h>
#include <assert.h>

long step;

static void *f(void * arg)
{
	step++;
	return (void*)step;
}

int main(int argc, char *argv[])
{
	thread_t t;
	long retval;
	step = 0;
	assert(!thread_create(&t, f, NULL));
	assert(!thread_join(t, (void**)(&retval)));
	assert(step == 1);
	assert(retval == step);
	return 0;
}
